Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODRefCntObject


Acquire

The Acquire method increments an object's reference count by 1.

void Acquire ();
DISCUSSION
Most methods that return a reference to a reference-counted object increment the object's reference count. However, if your part obtains a reference to a reference-counted object from a method that does not increment the object's reference count, you should call the object's Acquire method before you cache the reference in any data structure. When the reference is replaced or removed from the data structure, you should call the object's Release method to decrement its reference count.

OVERRIDING
Every subclass of ODRefCntObject has its own version of the Acquire method. Your subclass of ODPart overrides this method if your part performs any specific actions when its reference count is incremented. The override method must call its inherited Acquire method at the beginning of its implementation.

SEE ALSO
The ODRefCntObject::Release method (page 577).
The ODPart class (page 459).
Table 2-1 on page 90 in OpenDoc Programmer's Guide.
"Reference-Counted Objects" on page 468 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help